package org.eraser.common;

import lombok.*;

import java.io.Serializable;

@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@AllArgsConstructor
public class ResultEntity<T> implements Serializable {

    private T data;
    private String code;
    private String msg;

    public static <T> ResultEntity<T> result(T data, String code, String msg) {
        ResultEntity<T> result = new ResultEntity<>();
        result.setData(data);
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }

}
